
<div id="userbg">
    <?php if ( !bb_is_user_logged_in() ) {?>
        <form id="login_form" action="<?php bb_option('uri'); ?>bb-login.php" method="post" >
          <div class="margin-top10">MEMBER LOGIN</div>
          <div class="margin-top25">
            <div class="left margin-right10">USER</div>
            <div class="left" style="background: url(<?php bb_option('uri'); ?>my-templates/fusion_forum/img/userloginfield.jpg) no-repeat; height: 21px; width: 119px;">
              <input type="text" name="user_login" id="user" style="background: none; border: none; width: 119px; color: #FFFFFF;" />
            </div>
            <div class="left margin-right10 margin-top5">PASS</div>
            <div class="left margin-top5" style="background: url(<?php bb_option('uri'); ?>my-templates/fusion_forum/img/userloginfield.jpg) no-repeat; height: 21px; width: 119px;">
              <input type="password" name="password" id="pass" style="background: none; border: none; width: 119px; color: #FFFFFF;" />
          
          <input name="re" type="hidden" value="<?php echo $re; ?>" />
		<?php wp_referer_field(); ?>
            </div>
            <div class="clear"></div>
            <div class="margin-top10 margin-left40">
            <a  href="javascript:void(0);" onclick="loginsubmit();" onmouseout="MM_swapImgRestore()" 
            onmouseover="MM_swapImage('login','','<?php bb_option('uri'); ?>my-templates/fusion_forum/img/login_button_on.gif',1)"><img src="<?php bb_option('uri'); ?>my-templates/fusion_forum/img/login_button.gif" alt="" name="login" width="65" height="24" border="0" id="login" /></a></div>
            <div class="margin-top10 margin-left20 padding-left15" style="background: url(<?php bb_option('uri'); ?>my-templates/fusion_forum/img/arrow_yellow_icon.gif) no-repeat;"><a href="<?php bb_option('uri'); ?>/register.php">REGISTER</a></div>
            <div class="margin-top5 margin-left20 padding-left15" style="background: url(<?php bb_option('uri'); ?>my-templates/fusion_forum/img/arrow_yellow_icon.gif) no-repeat;"><a href="#">FORGOT PASSWORD</a></div>
          
          </div>
          <input name="remember"  type="hidden" id="remember" value="1"  />
          </form>
          <?php }else{ ?>
          
          
     <div><?php echo bb_get_current_user_info( 'name' ); ?></div>
			
		<div><a href="/bb-login.php?logout=1">ออกจากระบบ</a></div>


          
          <?php } ?>
        </div>
	<script type="text/javascript">
	 function loginsubmit()
	 {
		$("#login_form").submit();
	}
	</script>